#[cfg(test)]
mod test {
    use std::env;
    use std::fs::File;
    use std::io::Read;

    #[test]
    fn test_read_file() {
        let args: Vec<String> = env::args().collect();
        println!("{:?}", args);
        let filename = &args[1];
        let filename = "/Users/caedmonjiang/Code/rust/RustSamples/learn/src/chapter9/chapter9.rs";
        let mut f = File::open(filename).unwrap();
        let mut contents = String::new();
        f.read_to_string(&mut contents).unwrap();
        let mut sum = 0;
        for c in contents.lines() {
            let n = c.parse::<i32>().unwrap();
            sum += n;
        }
        println!("{:?}", sum);
    }
}